Object.defineProperty(exports, "__esModule", {
    value: !0
}), exports.default = void 0;

var e = function(e) {
    var t = e.method, a = e.header, o = e.url, r = e.data;
    return new Promise(function(e, n) {
        wx.request({
            url: o,
            method: t,
            header: a,
            data: r,
            success: function(t) {
                var a = t.data.code;
                0 === a ? e(t.data) : 501 === a ? wx.reLaunch({
                    url: "/pages/login/login"
                }) : (wx.showToast({
                    title: t.data.msg,
                    icon: "none",
                    duration: 1e3
                }), n(t.data));
            },
            fail: function(e) {
                n(e);
            }
        });
    });
};

exports.default = e;